package com.example.lecturereservation.mapper;

import com.example.lecturereservation.entity.Admin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AdminMapper extends BaseMapper<Admin>{

    @Select("select  * from admin where id=#{id}")
    public Admin getById(int id);

    @Insert("insert into admin values (null,#{email},#{password},#{name},#{telephone})")
    public void save(Admin t);

    @Select("select * from admin where email=#{email}")
    public Admin findByEmail(String email);

    public void deleteById(int id);

    public void update(Admin t);

    public List<Admin> getAll();

    public List<Admin> getPage(int start,int end);
}